tools/libxl: Fix free() of wild pointer in libxl__initiate_device_remove()
authorAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 18 Jun 2014 18:04:14 +0000 (19:04 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Mon, 23 Jun 2014 17:10:58 +0000 (18:10 +0100)
commitddb4aa5dfa13781e8f31ba20923c14c1a083ce83
treeee44f2e1d1fc7f5822e457d6775cd84d946fc804
parent0c615f8dadb4389048d574abd1515861d3f8403f
tools/libxl: Fix free() of wild pointer in libxl__initiate_device_remove()

libxl__initiate_device_remove() had a preexisting error path issue where
libxl_dominfo_dispose() could be called on a libxl_dominfo object before it
had been initialised with libxl_dominfo_init().

This was safe until c/s ab44401 added the pointer ssid_label, which point
libxl_dominfo_dispose() free()s.

Unconditionally initialise info in libxl__initiate_device_remove() before
taking an error path which will free it.

Coverity-ID: 1223212
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Wei Liu <wei.liu2@citrix.com>
CC: Ian Campbell <Ian.Campbell@citrix.com>
CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
tools/libxl/libxl_device.c